package com.carefree.bookmall.common.vo;

import java.util.List;

/**
 * @author Aurora
 */
public class PageVO<T> {
    /**
     * 页码
     */
    private int pageNumber;
    /**
     * 每页显示记录数
     */
    private int pageSize;
    /**
     * 记录总数
     */
    private int totalCount;
    /**
     * 总页数
     */
    private int totalPage;

    private List<T> list;

    public void SetPageSizeAndTotalCount(int pageSize, int totalCount) {
        this.pageSize = pageSize;
        this.totalCount = totalCount;
        totalPage = (int) Math.ceil((double) totalCount / pageSize);
    }

    public int getPageNumber() {
        return pageNumber;
    }

    public void setPageNumber(int pageNumber) {
        this.pageNumber = pageNumber;
    }

    public int getPageSize() {
        return pageSize;
    }

    public void setPageSize(int pageSize) {
        this.pageSize = pageSize;
    }

    public int getTotalCount() {
        return totalCount;
    }

    public void setTotalCount(int totalCount) {
        this.totalCount = totalCount;
    }

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }
}
